package cn.hamster3.hamsterworld.event;

import cn.hamster3.hamsterworld.data.WorldData;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

@SuppressWarnings("unused")
public class PrivateWorldDeleteEvent extends Event {
    private static HandlerList handlerList = new HandlerList();
    private WorldData worldData;

    public PrivateWorldDeleteEvent(WorldData worldData) {
        this.worldData = worldData;
    }

    public static HandlerList getHandlerList() {
        return handlerList;
    }

    /**
     * 世界被删除之前的WorldData对象
     * <p>
     * 由于此时世界已经被删除, 调用 {@link WorldData#getWorld()} 只会返回null
     * <p>
     * 且调用各种setter也不会影响rebuild之后的世界
     *
     * @return WorldData
     */
    public WorldData getWorldData() {
        return worldData;
    }

    @Override
    public HandlerList getHandlers() {
        return handlerList;
    }
}
